{"id":27946304,"url":"https://github.com/jeffneff/partyshim","last_synced_at":"2025-05-07T13:53:25.664Z","repository":{"id":241731173,"uuid":"689036090","full_name":"JeffNeff/PartyShim","owner":"JeffNeff","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-08T16:37:09.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-29T22:05:35.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JeffNeff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-08T16:36:33.000Z","updated_at":"2024-05-29T22:05:43.766Z","dependencies_parsed_at":"2024-05-29T22:05:42.018Z","dependency_job_id":"e573ca89-ddf9-41cc-9257-7b0a85c243bc","html_url":"https://github.com/JeffNeff/PartyShim","commit_stats":null,"previous_names":["jeffneff/partyshim"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffNeff%2FPartyShim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffNeff%2FPartyShim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffNeff%2FPartyShim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JeffNeff%2FPartyShim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JeffNeff","download_url":"https://codeload.github.com/JeffNeff/PartyShim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252892505,"owners_count":21820645,"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","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-05-07T13:53:22.921Z","updated_at":"2025-05-07T13:53:25.659Z","avatar_url":"https://github.com/JeffNeff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PartyShim\n\nPartyShim exists as a layer to seperate ownership of bridge contracts while still exposing an interface that `PartyBridge` can access.\n\n\n## Overview\n\n\n## Configure and Deploy\n\nThere is a pre-built docker image located at `gcr.io/mineonlium/partyshim` that you can use. Or feel free to build your own container image. \n\nChoose one of the following:\n\n1/ Kubernetes deployment and service manifests are located in `config/shim.yaml`\n\n1/ Docker compose file located in the root. \n\n1/ Bear metal execution of the binary.\n\nAfter selecting one of the following you will need to provide your runtime with several enviorment variables:\n       \n       * CONTRACT_ADDRESS - This should point to the deployed contract on the OUTSIDE network.\n       * PRIVATE_KEY - The private key that deployed the contract on the OUTSIDE network. \n       * DEFAULT_PAYMENT_PRIVATE_KEY - The private key that will be used if no private key is provided by `PartyBridge` at event time.\n       * RPC_URL - This should point a RPC server for the WRAPPED asset. \n       * RPC_URL2 - This should point to a RPC server for the NATIVE currency. \n       * SHIM_CA_CERT - This should contain the location of of both the `cert.pem` and `key_pkcs1.pem` files. (I.E. `/home/jeff/cert`)\n\n\n## Integrate a New Chain\n\nFollow the steps below to integrate a new chain with `PartyBridge`:\n\n1/ Deploy the contract located at `contract/bridge.sol` to the new chain. \n\n1/ Update `contract/deployments.md` with the contract address.\n\n1/ PR this repository with the changes. \n\n\n## Development\n\nExample request to the `/mint` route: \n```\ncurl -v \"https://45.79.60.232/mint\" \\\n       -X POST \\\n       -k \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"amount\": 10000, \"toAddress\":\"0x5dd4039c32F6EEF427D6F67600D8920c9631D59D\"}' \\\n       --cert ./client.crt \\\n       --key ./client.key\n```\n\n\nExample request to the `/transfer` route:\n\n```\ncurl -v \"https://0.0.0.0:8080/transfer\" \\\n       -X POST \\\n       -k \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"amount\": 100000000000000000, \"toAddress\":\"0x9cA67FFE69698d963A393E9338aD3BcfD2CEa02e\",\"fromPK\":\"\"}' \\\n       --cert ./client.crt \\\n       --key ./client.key\n\ncurl -v \"https://0.0.0.0:8080/transfer\" \\\n       -X POST \\\n       -k \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"amount\": 10000, \"toAddress\":\"0x5bbfa5724260Cb175cB39b24802A04c3bfe72eb3\"}' \\\n       --cert ./client.crt \\\n       --key ./client.key\n```\n\n\n\n\n\n\nGPT suggestion for creating and adding authority to certs\n\nFirst, create a configuration file named openssl.cnf with the following content:\n\n```\n[ req ]\ndefault_bits        = 2048\ndefault_keyfile     = server-key.pem\ndistinguished_name  = req_distinguished_name\nreq_extensions      = req_ext\n\n[ req_distinguished_name ]\ncountryName                 = AU\nstateOrProvinceName         = Some-State\nlocalityName               = City\norganizationName           = company\ncommonName                 = Internet Widgits Pty Ltd\ncommonName_max             = 64\n\n[ req_ext ]\nsubjectAltName          = @alt_names\n\n[alt_names]\nDNS.1   = partyshim-wgrams\nDNS.2   = partyshim-partychain-wocta\nDNS.3   = partyshim-partychain-bscusdt\n```\n\n\nMake sure to replace the IP.1 and IP.2 values with the correct IP addresses.\n\nNow, use the following commands to generate the self-signed certificate and add the subject alternative names:\n```\n# Generate the CA key and certificate\nopenssl genrsa -out ca.key 2048\nopenssl req -new -x509 -days 3650 -key ca.key -out ca.crt\n\n# Generate the server key\nopenssl genrsa -out server.key 2048\n\n# Create the server CSR using the configuration file\nopenssl req -new -key server.key -out server.csr -config openssl.cnf\n\n# Sign the server CSR with the CA key and certificate, using the configuration file\nopenssl x509 -req -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -extensions req_ext -extfile openssl.cnf\n\n\n# Generate the client key and certificate\nopenssl genrsa -out client.key 2048\nopenssl req -new -key client.key -out client.csr\nopenssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt\n```\n\nAfter following these steps, your server certificate should include the subject alternative names, and the connection should work as expected.\n\n\n\nbase64 encode for the kubernetes secret\n\ncat ca.crt | base64\ncat client.crt | base64\ncat client.key | base64\ncat server.crt | base64\ncat server.key | base64\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffneff%2Fpartyshim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeffneff%2Fpartyshim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeffneff%2Fpartyshim/lists"}