{"id":31923950,"url":"https://github.com/chainsafe/filecoindot","last_synced_at":"2025-10-13T23:59:13.997Z","repository":{"id":38329638,"uuid":"412006674","full_name":"ChainSafe/filecoindot","owner":"ChainSafe","description":"Filecoin to substrate bridge","archived":false,"fork":false,"pushed_at":"2023-03-07T01:24:32.000Z","size":3017,"stargazers_count":27,"open_issues_count":25,"forks_count":15,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-10-02T02:53:28.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChainSafe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-30T09:42:34.000Z","updated_at":"2024-05-06T22:31:43.000Z","dependencies_parsed_at":"2023-02-12T06:45:37.890Z","dependency_job_id":null,"html_url":"https://github.com/ChainSafe/filecoindot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ChainSafe/filecoindot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Ffilecoindot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Ffilecoindot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Ffilecoindot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Ffilecoindot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChainSafe","download_url":"https://codeload.github.com/ChainSafe/filecoindot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Ffilecoindot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017175,"owners_count":26086019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-13T23:58:42.532Z","updated_at":"2025-10-13T23:59:13.983Z","avatar_url":"https://github.com/ChainSafe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Filecoindot - FSB\n======================\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-ChainSafe/filecoindot-8da0cb?style=for-the-badge\u0026labelColor=555555\u0026logo=github\" height=\"20\"\u003e](https://github.com/ChainSafe/filecoindot)\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/github/workflow/status/ChainSafe/filecoindot/CI/main?style=for-the-badge\" height=\"20\"\u003e](https://github.com/ChainSafe/filecoindot/actions?query=branch%3Amain)\n[\u003cimg alt=\"license\" src=\"https://img.shields.io/badge/License-LGPL%20v3-blue?style=for-the-badge\" height=\"20\"\u003e](http://www.gnu.org/licenses/lgpl-3.0)\n\nA Substrate pallet to bridge from Filecoin to any blockchain built using the [Substrate](https://www.substrate.io/)\nframework, including Polkadot parachains.\n\n### Specifications\nThe detailed specs are available [here](https://docs.google.com/document/d/16QgEXP8TMFMsquWvs8iXhZRZ7mScXWQmP7-FeMXXT50/edit?usp=sharing)\n\n### Demo\n[Quick demo of FSB in action](https://www.youtube.com/watch?v=_zBZRN-OMtA)\n\n## Quick Start\n\n\n\nWe recommend to use our docker image for the quick start of the features filecoindot provide\n\n```\n# NOTE: If you are trying to run `filecoindot-template` on mac with apple silicon, please run `cargo build --release` to build the binary yourselves,\n# then run `./target/release/filecoindot-template --tmp --dev --unsafe-ws-external --unsafe-rpc-external --rpc-methods unsafe`\n#\n# see https://docs.docker.com/desktop/mac/apple-silicon/#known-issues\ndocker run -p 9933:9933 -p 9944:9944 ghcr.io/chainsafe/filecoindot-template --tmp --dev --unsafe-ws-external --unsafe-rpc-external --rpc-methods unsafe\n```\n\nAfter the node start emiting logs, run\n\n```shell\n# /filecoindot\nsh scripts/setup.sh\n```\n\nto setup our filecoindot node, the setup config by default is \n\n\n```json\n{\n  \"filecoindotRpc\": [\"https://api.node.glif.io\"],\n  \"id\": \"fdot\",\n  \"suri\": \"brief outside human axis reveal boat warm amateur dish sample enroll moment\",\n  \"ws\": \"ws://0.0.0.0:9944\"\n}\n```\n\n\n## How to integrate the Filecoin bridge pallet into a runtime?\n\n#### 0. configure `filecoindot` into your node\n\nHere we need to configure filecoindot into our runtime first, see [substrate-node-example](./substrate-node-example/README.md) \nfor detail.\n\n\n#### 1. set signer account to your node\n\nGenerate an account with [subkey](https://github.com/paritytech/substrate/tree/8b95e236582c209a1676d75a1db61a4916faabf5/bin/utils/subkey) for our offchain worker first\n\n```\n$ subkey generate\nSecret phrase `brief outside human axis reveal boat warm amateur dish sample enroll moment` is account:\n  Secret seed:      0x4ebb14295f95e62a865a457629a8e6d96ef5f3cf1896a9624d2e91e09f4cdc65\n  Public key (hex): 0x0676a4b19c66b31e12d15fe31ccbc775d3d2cda6e1c8686e395118f808eaa118\n  Account ID:       0x0676a4b19c66b31e12d15fe31ccbc775d3d2cda6e1c8686e395118f808eaa118\n  SS58 Address:     5CDBPWWtnLTqSUSNvB5BGYMs23Vs8dDHwWpjWpebBRErZM9W\n```\n\nand then, post your account to the node\n\n```\ncurl -X POST -H \"Content-type: application/json\"  http://localhost:9933 -d '\n{\n  \"method\": \"author_insertKey\",\n  \"jsonrpc\": \"2.0\",\n  \"id\": 0,\n  \"params\": [\n      \"fdot\",\n      \"brief outside human axis reveal boat warm amateur dish sample enroll moment\",\n      \"0x0676a4b19c66b31e12d15fe31ccbc775d3d2cda6e1c8686e395118f808eaa118\"\n  ]\n}\n'\n```\n\nMake sure you transfer some funds to this account. E.g using polkadot.js/apps and using some funds from the dev accounts.\n\n#### 2. set filecoin rpc endpoint to your node\n\n\n```\ncurl -X POST -H \"Content-type: application/json\"  http://localhost:9933 -d '\n{\n  \"method\": \"filecoindot_setRpcEndpoint\",\n  \"jsonrpc\": \"2.0\",\n  \"id\": 0,\n  \"params\": [ [\"https://api.node.glif.io\"] ]\n}\n'\n```\n\nIf you can see the logs below in your terminal\n\n```\n2021-10-31 21:58:55 Running in --dev mode, RPC CORS has been disabled.\n2021-10-31 21:58:55 Substrate Node\n2021-10-31 21:58:55 ✌️  version 3.0.0-9e5d007-aarch64-macos\n2021-10-31 21:58:55 ❤️  by Substrate DevHub \u003chttps://github.com/substrate-developer-hub\u003e, 2017-2021\n2021-10-31 21:58:55 📋 Chain specification: Development\n2021-10-31 21:58:55 🏷 Node name: fuzzy-doctor-8068\n2021-10-31 21:58:55 👤 Role: AUTHORITY\n2021-10-31 21:58:55 💾 Database: RocksDb at /Users/clearloop/Library/Application Support/node-template/chains/dev/db\n2021-10-31 21:58:55 ⛓  Native runtime: node-template-100 (node-template-1.tx1.au1)\n2021-10-31 21:58:55 Using default protocol ID \"sup\" because none is configured in the chain specs\n2021-10-31 21:58:55 🏷 Local node identity is: 12D3KooWPY6sbvMAryQkXRDKiApkd75Ak8x7cbgEqtiEzFxb5kQF\n2021-10-31 21:58:55 could not parse an IP from hosts file\n2021-10-31 21:58:57 📦 Highest known block at #168\n2021-10-31 21:58:57 〽️ Prometheus exporter started at 127.0.0.1:9615\n2021-10-31 21:58:57 Listening for new connections on 127.0.0.1:9944.\n2021-10-31 21:59:00 🙌 Starting consensus session on top of parent 0x6b98f8856f41abfb45da878188aaff1419c1cb6bbb8a56a346e9f1f39613a1a4\n2021-10-31 21:59:00 🎁 Prepared block for proposing at 169 [hash: 0x9f3941c44fdacc7f240b0471c97cd61e5010377619501285999ab0ff4d0edbbc; parent_hash: 0x6b98…a1a4; extrinsics (1): [0x1dd1…1b8b]]\n2021-10-31 21:59:00 🔖 Pre-sealed block for proposal at 169. Hash now 0x53480ec65b6b2c13126a96c62089af0244a570ba961efdd0d377a44df12a5a5b, previously 0x9f3941c44fdacc7f240b0471c97cd61e5010377619501285999ab0ff4d0edbbc.\n2021-10-31 21:59:00 ✨ Imported #169 (0x5348…5a5b)\n2021-10-31 21:59:00 bootstrap filecoindot ocw with filecoin rpc endpoint http://user:pass@infura.io\n```\n\nthe filecoindot offchain worker has been set up!\n\n\n#### 3. set the offchain worker's account as relayer\n\nIn the provided [substrate-node-example](./substrate-node-example/README.md), we configured the `type ManagerOrigin` of `filecoindot` with `frame_system::EnsureRoot\u003cAccountId\u003e`, so here we need to `add_relayer` with sudo access.\n\nFor setting relayer in `polkadot.js.org/apps`, we need to click `Developer -\u003e Sudo -\u003e filecoindot -\u003e add_relayer` and choose an account to be the new relayer.\n\nOr with [@polkadot/api](https://polkadot.js.org/docs/), you can use the code below:\n\n```typescript\nimport { ApiPromise, WsProvider } from \"@polkadot/api\";\nimport { rpc, types } from \"@chainsafe/fileconidot-types\";\nimport { Keyring } from \"@polkadot/keyring\";\n\n(async () =\u003e {\n    // setup the api\n    const provider = new WsProvider(\"http://0.0.0.0:9944\");\n    const api = await ApiPromise.create({ provider, types, rpc });\n    \n    // setup the signer\n    const keyring = new Keyring({ type: \"sr25519\" });\n    const signer = keyring.addFromUri(\"//Alice\");\n    \n    // execute the `add_relayer` extrinsic\n    const tx_hash = await api.tx.sudo\n      .sudo(this._.tx.filecoindot.addRelayer(signer.address))\n      .signAndSend(signer);\n})();\n```\n\n\n#### 4. Full Example\n\nSee [the example runtime](./substrate-node-example/runtime/src/lib.rs) for a full example showing how to integrate the pallet into\na substrate runtime.\n\n#### 5. Demo website \nOnce you have the node and container running you can test FSB going on https://filecoindot.chainsafe.io/ you will need to have the polkadot.js extention running and the substrate node https://polkadot.js.org/apps/#/explorer\n\n\n# ChainSafe Security Policy\n\n## Reporting a Security Bug\n\nWe take all security issues seriously, if you believe you have found a security issue within a ChainSafe project please\nnotify us immediately. If an issue is confirmed, we will take all necessary precautions to ensure a statement and patch\nrelease is made in a timely manner.\n\nPlease email us a description of the flaw and any related information (e.g. reproduction steps, version) to\n[security at chainsafe dot io](mailto:security@chainsafe.io).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainsafe%2Ffilecoindot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainsafe%2Ffilecoindot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainsafe%2Ffilecoindot/lists"}