hoytech / strfry

a nostr relay
GNU General Public License v3.0
502 stars 98 forks source link

Importing events from another relay using .jsonl import #74

Closed Darecjo closed 1 year ago

Darecjo commented 1 year ago

i tried to import a set of data exported from another relay to the deployed relay however none of the event are showing except one or two and im seeing the following results is there any particular format i need to follow exactly ? Screenshot 2023-10-05 at 12 00 31 PM

PS: the .jsonl file is exported from a nostream-db instance extracted from the postgresql using the following code:

Using psql:
\COPY (
    SELECT row_to_json(t)::text
    FROM (
        SELECT 
            event_content as content,
            event_created_at as created_at,
            encode(event_id, 'hex') as id,
            event_kind as kind,
            encode(event_pubkey, 'hex') as pubkey,
            encode(event_signature, 'hex') as sig,
            event_tags as tags
        FROM events
        WHERE deleted_at is null
    ) t
) TO '/tmp/events.jsonl';
hoytech commented 1 year ago

Can you paste a few lines from the file? It's probably they are malformed somehow, like maybe a level of quoting, or some leading data, or something like this.

Darecjo commented 1 year ago

@hoytech

sure yeah

{"content":"running branle","created_at":1640305962,"id":"41ce9bc50da77dda5542f020370ecc2b056d8f2be93c1cedf1bf57efcab095b0","kind":1,"pubkey":"5a462fa6044b4b8da318528a6987a45e3adf832bd1c64bd6910eacfecdf07541","sig":"08e6303565e9282f32bed41eee4136f45418f366c0ec489ef4f90d13de1b3b9fb45e14c74f926441f8155236fb2f6fef5b48a5c52b19298a0585a2c06afe39ed","tags":[]}

{"content":"+","created_at":1691455965,"id":"59567d7ef19e4a1629a0672b08396af12c134cc2cb5bd1617b9bbde268341c7e","kind":7,"pubkey":"d030bd233a1347e510c372b1878e00204b228072814361451623707896435da9","sig":"1603f760688dabf1acddd86a436178779b3599936a15ed860a9580276ae0746085d98891b3cd363bed71840a6a6c0c5c5bf758d804aa2b21a54a4b08f6894776","tags":[["e", "05c1aa2b88f3b7ceb5e851299bf163f15bc3c427828c054a1efcced89fd31d9f"]]}

{"content":"\\n\\n\\nThe creative industries have always been at the forefront of innovation, constantly exploring new ways to create and distribute art, music, and other forms of creative content. In recent years, the industry has undergone a major revolution, thanks to the advent of new technologies like NFTs and DAOs. These technologies are based on blockchain, a distributed ledger technology that allows for secure, transparent, and tamper-proof transactions.\\n\\n\\nNFTs, or non-fungible tokens, are unique digital assets that can be used to represent anything from art to music to in-game items. They are bought and sold on blockchain-based marketplaces, and they can be used to prove ownership of digital assets. DAOs, or decentralized autonomous organizations, are organizations that are governed by code rather than by people. They are made up of members who own tokens that give them voting rights. DAOs can be used to manage anything from art collectives to investment funds.\\n\\n\\nNFTs and DAOs are having a major impact on the creative industries. Artists are using NFTs to sell their work directly to collectors, without having to go through middlemen like galleries or record labels. This gives artists more control over their work and allows them to earn a higher percentage of the profits. Musicians are using NFTs to release new music and connect with their fans. For example, Grimes recently sold a collection of NFTs that included music, art, and experiences. The sale raised $5.8 million, and it helped Grimes to connect with her fans in a new way.\\n\\n\\nGame developers are using NFTs to create new in-game economies. For example, Axie Infinity is a blockchain-based game that allows players to earn cryptocurrency by breeding, raising, and battling digital pets. The game has over 2 million daily active users, and it has generated over $2 billion in revenue. These are just a few examples of how NFTs and DAOs are being used to revolutionize the creative industries.\\n\\n\\nHowever, the adoption of NFTs and DAOs has not been without its challenges. One of the biggest challenges facing these technologies is scalability. As the popularity of NFTs and DAOs continues to grow, the underlying blockchains are struggling to keep up with the demand. This has led to high transaction fees and slow confirmation times, making it difficult for some users to take advantage of these technologies.\\n\\n\\nTo address this issue, developers have been working on Layer1 and Layer2 technologies. Layer1 technologies are the underlying blockchains that support NFTs and DAOs. Some of the most popular Layer1 blockchains include Ethereum, Bitcoin, and Solana. Layer2 technologies are built on top of Layer1 blockchains and offer a number of benefits, such as increased scalability, lower transaction fees, and faster confirmation times. Some of the most popular Layer2 technologies include Polygon, Optimism, and Arbitrum.\\n\\nThe development of Layer1 and Layer2 technologies is making it easier for people to use NFTs and DAOs. As these technologies continue to develop, we can expect to see even more adoption of NFTs and DAOs in the creative industries.\\n\\nThe future of NFTs and DAOs in the creative industries is bright. These technologies have the potential to revolutionize the way we create, consume, and distribute art, music, and other forms of creative content. For example, NFTs could be used to sell digital art and music directly to collectors, giving artists more control over their work and allowing them to earn a higher percentage of the profits. DAOs could be used to manage creative projects, such as the production of a film or the development of a video game. This could potentially eliminate the need for traditional intermediaries like studios and publishers, giving creators more creative and financial control over their projects.\\n\\nMoreover, NFTs and DAOs have the potential to democratize the creative industries by giving underrepresented artists and creators a platform to showcase their work and reach a wider audience. This could lead to a more diverse and inclusive creative landscape.\\nHowever, there are also potential challenges and limitations to the adoption of NFTs and DAOs in the creative industries. One major concern is the environmental impact of blockchain technology, which has been criticized for its high energy consumption. Additionally, there are still issues around the accessibility and usability of these technologies, which could limit their adoption by creators and consumers alike.\\nNonetheless, the potential benefits of NFTs and DAOs in the creative industries are significant. As these technologies continue to develop and mature, we can expect to see even more innovative use cases and applications in the future. Whether it's through the sale of digital art and music, the management of creative projects, or the creation of new forms of fan engagement, NFTs and DAOs have the power to transform the creative industries as we know them today.\\n\\n\\n**The Role of Regulation in the Adoption of NFTs and DAOs**\\n\\n\\nAs NFTs and DAOs continue to gain popularity, there is a growing need for regulation. This is particularly true when it comes to the sale and distribution of NFTs, which can be used to represent everything from artwork to music to in-game items. Regulation can help to protect consumers and ensure that NFTs are sold in a fair and transparent manner. For example, regulators could require NFT marketplaces to verify the identity of sellers and ensure that the digital assets being sold are authentic.\\nRegulation could also help to address some of the environmental concerns associated with NFTs. The energy consumption of blockchain-based technologies like Ethereum has been a subject of criticism, as the network consumes a significant amount of energy to process transactions. Some NFT marketplaces are now using more energy-efficient blockchains, but regulatory bodies could impose standards to ensure that NFTs are produced in a sustainable way.\\n\\n\\n**Conclusion**\\n\\n\\nNFTs and DAOs are revolutionizing the creative industries by offering new ways for artists, musicians, and game developers to connect with their fans and monetize their work. The adoption of these technologies is being facilitated by the development of Layer1 and Layer2 blockchain technologies, which offer increased scalability, lower transaction fees, and faster confirmation times.\\n\\n\\nAs NFTs and DAOs continue to evolve, we can expect to see even more innovation in the creative industries. However, it is important to consider the role of regulation in ensuring that these technologies are used in a fair and transparent manner and produced in an environmentally sustainable way.\\n\\n\\nThe future of the creative industries is exciting, and NFTs and DAOs are playing a major role in shaping it. With their unique ability to empower creators and fans alike, these technologies are poised to transform the way we create, consume, and distribute art, music, and other forms of creative content.","created_at":1685226469,"id":"548ba308b7c6ac829054d681bca6294903329f08c1eef2e99622ba03d8740b84","kind":30023,"pubkey":"be73ff092415ad3942bec36666d3ac14af09a08fdb6c801558700e88c8539bee","sig":"21f939244a01907e0594561e7e8795557ed3db59abb804204e0644009097c877bbca2f95d0a61b65cf9e33494f898119bf788fb7e86c4e3485f1012dc3a2c140","tags":[["client", "yakihonne.com"], ["d", "F8dHXhptaI8fohakwSJM3"], ["image", "https://daorayaki-fs-bucket.s3.ap-east-1.amazonaws.com/be73ff092415ad3942bec36666d3ac14af09a08fdb6c801558700e88c8539bee/files/1684252887127-DAORAYAKIS3.png"], ["title", "From NFTs to DAOs: How Layer1 and Layer2 Technologies are Revolutionizing the Creative Industries"], ["summary", "This article \\"From NFTs to DAOs: How Layer1 and Layer2 Technologies are Revolutionizing the Creative Industries\\" explores the transformative impact of Layer1 and Layer2 blockchain technologies on the creative industries, with a particular focus on the rise of Non-Fungible Tokens (NFTs) and Decentralized Autonomous Organizations (DAOs).\\n\\nNFTs have gained immense popularity as unique digital assets that can represent ownership of various creative works, including artwork, music, videos, and more. Layer1 blockchains like Ethereum have been at the forefront of the NFT revolution, providing a secure and transparent platform for creating, trading, and owning these digital assets. The article delves into the fundamental concepts of NFTs, their benefits, and the impact they have had on artists, collectors, and the broader creative economy.\\n\\nLayer2 technologies, which serve as scalability solutions for Layer1 blockchains, are playing a crucial role in addressing the challenges associated with high fees and network congestion. By leveraging techniques such as sidechains, state channels, and rollups, Layer2 solutions enhance transaction throughput, reduce costs, and improve the overall user experience. The article explores how Layer2 technologies are being applied to NFTs and the creative industries, facilitating faster and more affordable transactions while ensuring the security and integrity of these digital assets.\\n\\nIn addition to NFTs, the article also explores the emergence of DAOs, which are decentralized, community-governed organizations built on blockchain technology. DAOs leverage smart contracts and tokenomics to enable collective decision-making and resource allocation within creative communities. The article discusses the benefits of DAOs in empowering artists, creators, and fans, allowing for new models of collaboration, funding, and content distribution.\\n\\nThrough a combination of insightful analysis, real-world examples, and interviews with industry experts, the article highlights the transformative potential of Layer1 and Layer2 technologies in revolutionizing the creative industries. It explores the challenges and opportunities presented by NFTs and DAOs, offering readers a comprehensive overview of how blockchain technology is reshaping the way we create, consume, and interact with digital content."], ["t", "nos.lol"]]}

{"content":"**Introduction**\\nBitcoin, the pioneering cryptocurrency, has gained significant attention not only as a medium of exchange but also as a potential store of value. In this article, we will delve into the technical aspects of Bitcoin's resilience as a store of value, exploring its ability to withstand market volatility and its potential as a hedge against economic uncertainty.\\n\\n**1. The Fundamental Characteristics of Bitcoin**\\nTo understand Bitcoin's role as a store of value, it is crucial to grasp its fundamental characteristics. Bitcoin operates on a decentralized blockchain, where transactions are verified and recorded in a transparent and immutable manner. Key features that contribute to its potential as a store of value include scarcity, divisibility, durability, and fungibility.\\n\\n**Scarcity:** Bitcoin has a finite supply, with a total cap of 21 million coins. This limited supply ensures that Bitcoin is resistant to inflationary pressures often associated with fiat currencies.\\nDivisibility: Bitcoin is divisible into smaller units, allowing for transactions of any value. This divisibility enhances its usability and accessibility as a medium of exchange and a store of value.\\n\\n**Durability:** Bitcoin's digital nature eliminates concerns associated with physical assets. As long as the private keys securing one's Bitcoin holdings are adequately safeguarded, the digital nature of Bitcoin ensures its durability over time.\\n\\n**Fungibility:** Bitcoin's fungibility refers to the interchangeability of individual units. Each Bitcoin is identical to another, making it fungible and ensuring that it can serve as a consistent store of value.\\n\\n**2. Bitcoin's Resilience to Market Volatility**\\nOne of the key criticisms leveled against Bitcoin is its perceived volatility. While it is true that Bitcoin has experienced significant price fluctuations, it has also demonstrated resilience and an ability to recover from downturns.Bitcoin's volatility can be attributed to various factors, including market sentiment, regulatory developments, macroeconomic events, and technological advancements. However, it is essential to view Bitcoin's price movements in the context of its relatively short existence and growing adoption.\\nOver the years, Bitcoin has experienced several market cycles characterized by periods of rapid price appreciation followed by corrections. Each cycle has seen Bitcoin's price reach new all-time highs, demonstrating its ability to recover and continue its upward trajectory over the long term. This resilience has instilled confidence among investors and contributed to Bitcoin's reputation as a potential store of value.\\n\\n**3. Bitcoin as a Hedge Against Economic Uncertainty**\\nBitcoin's decentralized nature and limited supply position it as a potential hedge against economic uncertainty and traditional financial systems. During times of economic instability, investors often seek alternative assets that are not subject to the same risks as traditional fiat currencies. Bitcoin's fixed supply, combined with its lack of dependence on any centralized authority or government, makes it an attractive option for those seeking to hedge against inflation and economic turmoil. Additionally, its global accessibility and ease of transfer across borders provide individuals with the ability to move funds quickly and securely, irrespective of geopolitical or economic circumstances.\\n\\n**4. Considerations and Risks**\\nWhile Bitcoin offers potential as a store of value, it is essential to acknowledge the considerations and risks associated with its adoption. Bitcoin's price volatility, regulatory uncertainty, technological risks, and market liquidity are factors that investors should carefully evaluate.\\nMoreover, the nascent nature of the cryptocurrency market means that it is still developing and evolving. As such, there may be unforeseen challenges and risks that emerge over time. It is crucial for investors to conduct thorough research, exercise caution, and consider Bitcoin's role within a well-diversified investment portfolio.\\n\\n**5. Conclusion**\\nBitcoin's emergence as a potential store of value has sparked discussions and debates about its resilience amidst market volatility. While Bitcoin's price history has shown significant volatility, its ability to recover from downturns and its potential as a hedge against economic uncertainty cannot be overlooked. Bitcoin's fundamental characteristics, including scarcity, divisibility, durability, and fungibility, contribute to its suitability as a store of value. Despite its short existence, Bitcoin has demonstrated resilience and the ability to recover from market downturns. Each market cycle has seen Bitcoin reach new all-time highs, indicating its long-term potential as a store of value. However, investors must consider the risks associated with Bitcoin, including price volatility, regulatory uncertainties, technological risks, and market liquidity.\\n\\nBitcoin's decentralized nature and limited supply position it as a potential hedge against economic uncertainty and traditional financial systems. Its independence from centralized authorities and its global accessibility make it an attractive option for individuals seeking to protect their wealth from inflation and economic instability. While Bitcoin offers opportunities, it is important to exercise caution and conduct thorough research before investing. The cryptocurrency market is still evolving, and unforeseen challenges may arise. As with any investment, diversification and risk management are key principles to consider.\\nFurthermore, the adoption and acceptance of Bitcoin as a store of value are influenced by various factors. Regulatory frameworks, institutional involvement, and public perception play significant roles in shaping Bitcoin's future as a recognized and widely accepted store of value.As the cryptocurrency landscape continues to evolve, it is crucial to monitor developments and advancements in technology, regulation, and market trends. The integration of Bitcoin into traditional financial systems and the emergence of new infrastructure and services will also impact its role as a store of value.\\n\\nFinally, Bitcoin's potential as a store of value lies in its fundamental characteristics, resilience amidst market volatility, and ability to act as a hedge against economic uncertainty. While risks and considerations exist, Bitcoin's decentralized nature and growing adoption make it an intriguing asset for individuals seeking alternatives to traditional financial systems. By understanding the technical aspects and conducting careful analysis, investors can make informed decisions regarding Bitcoin's role within their investment portfolios.\\n","created_at":1685010971,"id":"84b6c34045a0f25f0758da6db44079304d162bacb446e05035523abec6e82fb1","kind":30023,"pubkey":"8f014c5aafb425b2fa414a49eb9ab17269f155937db67a5babe7bc40f9bbae3b","sig":"b3d1de8e59367cf1079f3c84577928fadc81231744e2a9348400b787f1ab0e564335e0dfaaf45d99d26683b39f69491cc900f2fcbaffefaf0cb3bc6effe9cf0f","tags":[["client", "yakihonne.com"], ["d", "0DHWhq_C-kGCZH-8p2ETy"], ["image", "https://daorayaki-fs-bucket.s3.ap-east-1.amazonaws.com/8f014c5aafb425b2fa414a49eb9ab17269f155937db67a5babe7bc40f9bbae3b/files/1685010973541-DAORAYAKIS3.PNG"], ["title", "Bitcoin as a Store of Value: Examining its Resilience Amidst Market Volatility"], ["summary", "This article investigates Bitcoin's role as a store of value, analyzing its ability to withstand market volatility and its potential as a hedge against economic uncertainty.\\n"], ["t", "nostr-01.yakihonne.com"]]}

PS: i found some lines with in them however im not sure, the thing im sure about is that the data is assured and works fine with the other relay, i managed some content to be parsed normally however the majority of it is missing. I also tried to used the sed $'s/\u2029/HERE(&)/g' events.jsonl command to clean up the file but nothing happened

Darecjo commented 1 year ago

You're right the file was malformed technically since it is exported the \ was doubled \\ due the postgresql exporting function. Screenshot 2023-10-28 at 2 09 22 PM

Problem solved thanks.

hoytech commented 1 year ago

Ahhh, thanks for letting us know!