Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xdr: add instructions for generating xdr #4280

Merged
merged 2 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace :xdr do

HAYASHI_XDR.each do |src|
local_path = "xdr/" + File.basename(src)
encoded = client.contents("stellar/stellar-core", path: src).content
encoded = client.contents("stellar/stellar-core", query: {ref: "master"}, path: src).content
decoded = Base64.decode64 encoded

IO.write(local_path, decoded)
Expand Down
21 changes: 21 additions & 0 deletions xdr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# xdr

The xdr package contains encoding/decoding of Stellar XDR types.

## Code Generate

Most of the code this package is generated.

To download new XDR for code generation:

```
docker run --platform linux/amd64 -it --rm -v $PWD:/wd -w /wd ruby /bin/bash -c 'bundle install && bundle exec rake xdr:download'
```

To regenerate the code from the local XDR:

```
docker run --platform linux/amd64 -it --rm -v $PWD:/wd -w /wd ruby /bin/bash -c 'bundle install && bundle exec rake xdr:generate' && go fmt ./xdr
```

To download XDR for a different branch of stellar-core, modify `Rakefile` in the root.